package com.classes.constants.logic;

import java.nio.ByteBuffer;

public class Constants_utf_info extends ConstantsAbstract {
    private short length;
    private byte[] content;

    public Constants_utf_info(byte tag) {
        super(tag);
    }

    @Override
    public void parse(ByteBuffer buffer) {
        this.length = buffer.getShort();
        content = new byte[length];
        buffer.get(content, 0, length);
    }


    @Override
    public String toString() {
        return "tag=" + tag + "  length=" + length + " content=" + new String(content);
    }

    @Override
    public String getContent() {
        return new String(content);
    }


}
